-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Adapt Field to run on GPU #746
Conversation
What is an easy way to reproduce the above failure? cc: @maleadt |
We could make it so that passing |
What does
mean? |
CUDA uses a special buffer, the parameter space, to put arguments in. This buffer is about 4K large, and has special semantics that benefit performance (read-only, so threads can read from it without synchronizing, etc). Although arguments in Julia are normally passed by reference, i.e. putting pointers in that space, when invoking kernels we change the calling convention and pass by reference such that loading e.g. the size or pointer of an array doesn't synchronize threads. That works great, until you pass a large (number of) arguments as you apparently do. |
Thanks @maleadt, that's very helpful! In this PR, we haven't directly changed any kernel function signatures. However, this PR does pass more complicated objects into kernels (a wrapper around an The changes made in this PR are not strictly necessary --- they are a convenience. If manually unwrapping |
It's a hardware limitation, really. The compiler could anticipate though, e.g. by not passing very large objects by value, or by providing an escape hatch (like the |
Superceded by #1057 |
This PR attempts to use
adapt_structure
forOceananigans.Fields
so that they can be used as arguments in kernels on the GPU.After fixing a few related issues, attempts at compilation on the GPU fail with the error
I don't have too much hope that I can solve this (the burden on the compiler is too great?), but I'm opening this PR as a way to record what I've done.
Resolves #722